//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.ehl.capture.db;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;

import java.util.ArrayList;
import java.util.List;

public class DBProxyZdkk {
    public static Logger logger = Logger.getLogger(DBProxyZdkk.class);

    private static List<String> kkList = new ArrayList<>();
    // 用于存储超时的重点卡口
    private static List<String> kkOverTimeList = new ArrayList<>();

    public static List<String> getKkOverTimeList() {
        return kkOverTimeList;
    }

    public static List<String> getKkList() {
        if(CollectionUtils.isEmpty(kkList)){
            kkList = getZdkk();
        }
        return kkList;
    }

    private static List<String> getZdkk() {
        String sql = "select * from t_wxs_zdkk";
        Object[][] resList = DBProxy.getMultiResult("db", sql);

        List kkList = new ArrayList();
        if(resList != null){
            for(int i=0;i<resList.length;i++){
                String kkbh = (String)resList[i][1];
                if(StringUtils.isNotBlank(kkbh)){
                    kkList.add(kkbh);
                }
            }
        }

        return kkList;
    }


    public static void main(String[] args) {
        new DbConfig().init();
        List<String> kkList = getZdkk();
        for (String item : kkList) {
            System.out.println("卡口ID：" + item);
        }
    }
}
